package il.ac.technion.wiki.api;

import il.ac.technion.wiki.api.IWikiEngine.IWikiContent;
import il.ac.technion.wiki.api.search.ISearchExpression;

/**
 * Specifies an interface to be used for ranking wiki content based on its
 * match to a search query.
 *
 */
public interface IContentRanker {
	/**
	 * <p>
	 * Assigns an integer rank to a piece of content based on the provided search expression tree.
	 * </p>
	 * The rank does not necessarily have any inherent meaning outside the context of
	 * the ranker, but it is guaranteed to be internally consistent, such that content
	 * better correlated with the search terms (as considered by the ranker) will be
	 * given a higher ranking.
	 * @param content	The piece of content to rank.
	 * @param expr		The search expression tree to rank for.
	 * @return			An integer ranking for the content.
	 */
	public int rank(IWikiContent content, ISearchExpression expr);
	
	/**
	 * Specifies the list of words to be considered "neutral" when ranking.
	 * @param words	An array of neutral words.
	 */
	public void setNeutralWords(String words[]);
	
	/**
	 * Specifies the list of words to stop be considered as "neutral" when ranking.
	 * @param words	An array of non-neutral words.
	 */
	public void removeNeutralWords(String[] words);
}
